package com.bdqn.qnnews.article.convert;

import com.bdqn.qnnews.articel.api.dto.ApArticleDto;
import com.bdqn.qnnews.article.entity.ApArticle;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author xlzhang
 * @date 2024/1/3 9:33
 */
@Mapper
public interface ApArticleConvert {
    /**
     * 转换类实例
     */
    ApArticleConvert INSTANCE = Mappers.getMapper(ApArticleConvert.class);


    /**
     * dto 转换为 ApArticle
     * @param dto dto对象
     * @return 实体对象
     */
    ApArticle dtoToEntity(ApArticleDto dto);

    /**
     * entity转换为dto
     * @param entity entity
     * @return
     */
    ApArticleDto entityToDto(ApArticle entity);
}
